from django.db import models
from db.base_model import BaseModel

# Create your models here.

class Record(BaseModel):
    username = models.CharField("用户", default="未知", blank=True, max_length=10)
    open_time = models.DateTimeField()
    avatar = models.ImageField(default='Louis-LOGO.jpg',
                               upload_to='Security_avatar', verbose_name='快照')
    limit = models.CharField("权限", default="用户", max_length=5)

    def __str__(self):
        return str(self.id)


    class Meta:
        db_table = "louis_security"
        verbose_name = "门禁记录"
        verbose_name_plural = verbose_name
        get_latest_by = "id"